package com.infore.dataAudit.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedAttributeNode;
import javax.persistence.NamedEntityGraph;
import javax.persistence.NamedQuery;
import javax.persistence.NamedSubgraph;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;


/**
 * The persistent class for the T_DATA_AUDIT database table.
 * 
 */
@NamedEntityGraph(name="dataAudit_view",
attributeNodes={
    @NamedAttributeNode("auditDetailsList"),
}
)
@Entity
@Table(name="T_DATA_AUDIT")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@NamedQuery(name="TDataAudit.findAll", query="SELECT t FROM TDataAudit t")
public class TDataAudit implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Column(name="C_TIME")
	private Date createTime;

	@Column(name="FLOW_INSTANCE_ID")
	private String flowInstanceId;

	@Column(name="PROJ_ID")
	private String projId;

	@Column(name="PROJ_NAME")
	private String projName;

	@Column(name="PROJ_UNIT")
	private String projUnit;

	@Column(name="PROJ_VALUE")
	private Double projValue;

	@Column(name="STATION_MN")
	private String stationMn;

	@Column(name="STATION_NAME")
	private String stationName;
	
	/** 系统审核状态 **/
	@Column(name="XT_AUDIT")
	private String xtAudit;
	
	/** 系统审核状态描述**/
	@Column(name="XT_AUDIT_DESC")
	private String xtAuditDesc;
	
	/** 最终数据是否有效状态 **/
	@Column(name="AUDIT_STATUS")
    private String auditStatus;
	
	/** 最终数据是否有效状态描述 **/
    @Column(name="AUDIT_STATUS_DESC")
    private String auditStatusDesc;

	//bi-directional many-to-one association to TDataAuditDetail
	//@JsonIgnoreProperties(value = { "dataAudit","auditDetailsList"})
	@OneToMany(mappedBy="dataAudit", cascade = CascadeType.ALL)
	private List<TDataAuditDetail> auditDetailsList;
	
	@Transient
    private String stationCompany; //运营单位
    @Transient
    private String stationProvin; //省级
    @Transient
    private String stationCity;//市级
    

	public TDataAudit() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getFlowInstanceId() {
		return this.flowInstanceId;
	}

	public void setFlowInstanceId(String flowInstanceId) {
		this.flowInstanceId = flowInstanceId;
	}

	public String getProjId() {
		return this.projId;
	}

	public void setProjId(String projId) {
		this.projId = projId;
	}

	public String getProjName() {
		return this.projName;
	}

	public void setProjName(String projName) {
		this.projName = projName;
	}

	public String getProjUnit() {
		return this.projUnit;
	}

	public void setProjUnit(String projUnit) {
		this.projUnit = projUnit;
	}

	public Double getProjValue() {
		return this.projValue;
	}

	public void setProjValue(Double projValue) {
		this.projValue = projValue;
	}

	public String getStationMn() {
		return this.stationMn;
	}

	public void setStationMn(String stationMn) {
		this.stationMn = stationMn;
	}

	public String getStationName() {
		return this.stationName;
	}

	public void setStationName(String stationName) {
		this.stationName = stationName;
	}

	public String getXtAudit() {
		return this.xtAudit;
	}

	public void setXtAudit(String xtAudit) {
		this.xtAudit = xtAudit;
	}

	public String getXtAuditDesc() {
		return this.xtAuditDesc;
	}

	public void setXtAuditDesc(String xtAuditDesc) {
		this.xtAuditDesc = xtAuditDesc;
	}

	
	public List<TDataAuditDetail> getAuditDetailsList() {
        return auditDetailsList;
    }

    public void setAuditDetailsList(List<TDataAuditDetail> auditDetailsList) {
        this.auditDetailsList = auditDetailsList;
    }

    public TDataAuditDetail addTDataAuditDetail(TDataAuditDetail TDataAuditDetail) {
        getAuditDetailsList().add(TDataAuditDetail);
		TDataAuditDetail.setDataAudit(this);

		return TDataAuditDetail;
	}

	public TDataAuditDetail removeTDataAuditDetail(TDataAuditDetail TDataAuditDetail) {
	    getAuditDetailsList().remove(TDataAuditDetail);
		TDataAuditDetail.setDataAudit(null);

		return TDataAuditDetail;
	}
	public String getStationCompany() {
        return stationCompany;
    }

    public void setStationCompany(String stationCompany) {
        this.stationCompany = stationCompany;
    }

    public String getStationProvin() {
        return stationProvin;
    }

    public void setStationProvin(String stationProvin) {
        this.stationProvin = stationProvin;
    }

    public String getStationCity() {
        return stationCity;
    }

    public void setStationCity(String stationCity) {
        this.stationCity = stationCity;
    }

    public String getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getAuditStatusDesc() {
        return auditStatusDesc;
    }

    public void setAuditStatusDesc(String auditStatusDesc) {
        this.auditStatusDesc = auditStatusDesc;
    }
    
}